package models

import (
	"errors"
)

type User struct {
	DefaultModel
	Email        string `json:"email"`
	Phone        string `json:"phone"`
	DOB          string `json:"dob"`
	FavoriteCity string `json:"favorite_city"`
	Admin        bool   `json:"admin"`
	AuthToken    string `json:"auth_token"`
}

func GetUsers() []User {
	var users []User
	var db = GetDB()
	db.Find(&users)
	return users
}

func GetUserByID(id string) (User, error) {
	var user User
	var db = GetDB()
	db.First(&user)
	return user, nil
}

func GetUserByAuthToken(token string) (User, error) {
	return User{}, errors.New("Not found")
}
